﻿using FluentNHibernate.Mapping;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace mscook.core.domain
{
    public class ChefMap : ClassMap<Chef>
    {
        public ChefMap()
        {
            Id(o => o.Id);
            Map(o => o.CreateTime);
            Map(o => o.IsDelete);
            Map(o => o.Version);
            Map(o => o.EntityIndex);
            Map(o => o.ImageName);
            Map(o => o.Name);
            Map(o=>o.Position);
            Map(o=>o.Address);
            Map(o=>o.Summary).CustomType("StringClob").CustomSqlType("nvarchar(max)");
            Map(o=>o.Editor);
            References<Hotel>(o => o.Hotel).Nullable().Column("HotelId");
            HasMany<CookBook>(o => o.CookBooks).KeyColumn("ChefId");
            Map(o => o.Description).CustomType("StringClob").CustomSqlType("nvarchar(max)");

        }
    }
}
